local qingjue = fk.CreateSkill{
    name = "ym2__qingjue",
}
Fk:loadTranslationTable{
    ["ym2__qingjue"] = "倾绝",
    [":ym2__qingjue"] = "每种牌名各限一次，你可以视为使用一张基本牌；若如此做，本局游戏剩余时间内，你该牌名的手牌均视为【决斗】",
    ["#ym2__qingjue"] = "倾绝：视为使用一张基本牌，然后此牌名的手牌视为【决斗】",
    ["@[ym2__qingjue]"] = "倾绝",

    ["$ym2__qingjue1"] = "打虎亲兄弟，上阵父子兵！",
    ["$ym2__qingjue2"] = "你伪汉五虎，可敌不过我韩家五虎！",
}
Fk:addQmlMark{
    name = "ym2__qingjue",
    qml_path = "",
    how_to_show = function(_, value)
        if type(value) ~= "table" then return " " end
        return table.concat(table.map(Fk:getAllCardNames("b",true), function(name)
            if table.contains(value,name) then
                return "<font color=#cacaca><s>"..Fk:translate(name,"zh_CN").."</s></font>"
            else
                return Fk:translate(name,"zh_CN")
            end
        end), "")
    end,
}
qingjue:addEffect("viewas",{
    anim_type = "special",
    pattern = ".|.|.|.|.|basic|",
    prompt = "#ym2__qingjue",
    interaction = function(self, player)
        local all_names = table.filter(Fk:getAllCardNames("b",true), function (name)
            return not table.contains(player:getTableMark("@[ym2__qingjue]"), name)
        end)
        local names = player:getViewAsCardNames(qingjue.name, all_names)
        if #names == 0 then return end
        return UI.CardNameBox { choices = names, all_choices = all_names }
    end,
    card_filter = Util.FalseFunc,
    view_as = function(self, player, cards)
        if self.interaction.data == nil then return end
        local card = Fk:cloneCard(self.interaction.data)
        card.skillName = qingjue.name
        return card
    end,
    after_use = function(self, player, use)
        local room = player.room
        room:addTableMark(player, "@[ym2__qingjue]", use.card.trueName)
    end,
    enabled_at_play = function(self, player)
        local all_names = table.filter(Fk:getAllCardNames("b",true), function (name)
            return not table.contains(player:getTableMark("@[ym2__qingjue]"), name)
        end)
        return #all_names > 0
    end,
    enabled_at_response = function(self, player, response)
        local all_names = table.filter(Fk:getAllCardNames("b",true), function (name)
            return not table.contains(player:getTableMark("@[ym2__qingjue]"), name)
        end)
        return not response and #player:getViewAsCardNames(qingjue.name, all_names) > 0
    end,
})
qingjue:addAcquireEffect(function (self, player, is_start)
    player.room:setPlayerMark(player,"@[ym2__qingjue]",{})
end)
--[[qingjue:addLoseEffect(function (self, player, is_death)
    player.room:setPlayerMark(player,"@[ym2__qingjue]",0)
end)]]--
qingjue:addEffect("filter",{
    anim_type = "offensive",
    global = true,
    card_filter = function(self, card, player)
        return player:hasSkill(qingjue.name) and table.contains(player:getTableMark("@[ym2__qingjue]"), card.trueName)
    end,
    view_as = function(self, player, card)
        local to = Fk:cloneCard("duel", card.suit, card.number)
        return to
    end,
})
return qingjue